package com.soft.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.soft.entity.Schedule;

@Mapper
public interface ScheduleMapper extends BaseMapper<Schedule> {

	// 原子更新状态并刷新更新时间，避免受实体映射或数据库 ON UPDATE 配置影响
	@Update("UPDATE schedule SET status = #{status}, update_time = NOW() WHERE schedule_id = #{id}")
	int updateStatus(@Param("id") Integer id, @Param("status") String status);
}
